home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / libgphoto2-2 / linux-hotplug / usbcam.user < prev    next >
Encoding:
Text File  |  2009-01-07  |  1007 b   |  32 lines

  1. #!/bin/bash
  2. # $Id: usbcam.user 9668 2006-12-18 16:31:44Z hun $
  3. #
  4. # /etc/hotplug/usb/usbcam
  5. #
  6. # Sets up newly plugged in USB camera so that just one certain user
  7.  
  8. USER=root
  9.  
  10. # can access it from user space. (Replace root with the user you want
  11. # to have access to the cameras.)
  12. #
  13. # Note that for this script to work, you'll need all of the following:
  14. # a) a line in the file /etc/hotplug/usermap that corresponds to the 
  15. #    camera you are using. You can get the correct lines for all cameras 
  16. #    supported by libgphoto2 by running
  17. #              $ print-camera-list usb-usermap usbcam
  18. # b) run your camera software as the user given above
  19. # c) a Linux kernel supporting hotplug and usbdevfs
  20. # d) the hotplug package (http://linux-hotplug.sourceforge.net/)
  21. #
  22. # In the usermap file, the first field "usb module" should be named 
  23. # "usbcam" like this script.
  24.  
  25. if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
  26. then
  27.     chmod a-rwx "${DEVICE}"
  28.     chown "${USER}" "${DEVICE}"
  29.     chmod u+rw "${DEVICE}"
  30. fi
  31.